/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sn.dao;

import java.util.List;
import org.springframework.stereotype.Component;
import sn.metier.Notification;

/**
 *
 * @author Pluce
 */

@Component
public class NotificationDAOImpl extends GenericDAOImpl<Notification> implements NotificationDAO {

    @Override
    protected Class<Notification> entityClass() {
        return Notification.class;
    }

    @Override
    public List<Notification> findNonLuByDestinataire(Long idpers) {
        return this.em.createQuery("SELECT n FROM Notification n WHERE n.destinataire.id = ? AND n.isLu = false").setParameter(1, idpers).getResultList();
    }
    
}
